import asyncio
import websockets
import time


async def ws_client(url):
    for i in range(1, 5):
        async with websockets.connect(url) as websocket:
            await websocket.send(str({"type": "request", "data": "Hello, I am jerry."}))
            response = await websocket.recv()
        print(response)
        time.sleep(1)

asyncio.run(ws_client("ws://localhost:9999"))
